<template>
    <div>
      <div class="title">
        <div class="icon">
             <van-icon name="arrow-left" />
        </div>
        <h2>收藏列表</h2>
      </div>
       <div class="list" v-for="(item,index) in list" :key="index" @click="goDetail(index)">
      <div class="pic">
        <img :src="`http://liufusong.top:8080${item.imgImg}`" alt="" />
      </div>
      <div class="right">
        <h3>{{item.title}}</h3>
        <div class="detail">{{item.desc}}</div>
        <div class="sub"><span>{{item.tags}}</span></div>
        <p><span>{{item.price}}</span>元/月</p>
      </div>
    </div>
    </div>
</template>

<script>
import axios from 'axios';
export default {
    name: 'HouseCollect',

    data() {
        return {
            list:[]
        };
    },

    mounted() {
        this.getCollect()
    },

    methods: {
        async getCollect(){
          const res = await axios({
            url:'http://liufusong.top:8080/user/favorites'
          })
          console.log(res);
        }
    },
};
</script>

<style lang="less" scoped>
.title{
    height:45px ;
    background-color: #21b97a;
    line-height: 45px;
    // text-align: center;
    .icon{
    display: inline-block;
    padding-left: 15px;
    }
    h2{
    display: inline-block;
    font-size: 18px;
    margin: 0 auto;
    padding-left: 111px;
    font-weight: 400;
    color: #fff;
    }
}
</style>